package com.manpower.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * MpUser entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "mp_user", catalog = "manpower")
public class MpUser implements java.io.Serializable {

	// Fields

	private String id;
	private String userName;
	private String userRealname;
	private String userPwd;
	private String userPhone;
	private String userRoleId;
	private Set<MpUserRole> mpUserRoles = new HashSet<MpUserRole>(0);
	private Set<MpRecruitment> mpRecruitments = new HashSet<MpRecruitment>(0);

	// Constructors

	/** default constructor */
	public MpUser() {
	}

	/** minimal constructor */
	public MpUser(String id) {
		this.id = id;
	}

	/** full constructor */
	public MpUser(String id, String userName, String userRealname,
			String userPwd, String userPhone, String userRoleId,
			Set<MpUserRole> mpUserRoles, Set<MpRecruitment> mpRecruitments) {
		this.id = id;
		this.userName = userName;
		this.userRealname = userRealname;
		this.userPwd = userPwd;
		this.userPhone = userPhone;
		this.userRoleId = userRoleId;
		this.mpUserRoles = mpUserRoles;
		this.mpRecruitments = mpRecruitments;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "user_name", length = 20)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "user_realname", length = 200)
	public String getUserRealname() {
		return this.userRealname;
	}

	public void setUserRealname(String userRealname) {
		this.userRealname = userRealname;
	}

	@Column(name = "user_pwd", length = 36)
	public String getUserPwd() {
		return this.userPwd;
	}

	public void setUserPwd(String userPwd) {
		this.userPwd = userPwd;
	}

	@Column(name = "user_phone", length = 11)
	public String getUserPhone() {
		return this.userPhone;
	}

	public void setUserPhone(String userPhone) {
		this.userPhone = userPhone;
	}

	@Column(name = "user_role_id", length = 36)
	public String getUserRoleId() {
		return this.userRoleId;
	}

	public void setUserRoleId(String userRoleId) {
		this.userRoleId = userRoleId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpUser")
	public Set<MpUserRole> getMpUserRoles() {
		return this.mpUserRoles;
	}

	public void setMpUserRoles(Set<MpUserRole> mpUserRoles) {
		this.mpUserRoles = mpUserRoles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpUser")
	public Set<MpRecruitment> getMpRecruitments() {
		return this.mpRecruitments;
	}

	public void setMpRecruitments(Set<MpRecruitment> mpRecruitments) {
		this.mpRecruitments = mpRecruitments;
	}

}